home *** CD-ROM | disk | FTP | other *** search
- #! /bin/csh -f
- #
- # $Header: /usr/people/carlson/scripts/RCS/Comprcs,v 1.3 91/07/27 19:57:33 chris Exp $
- #
- # Comprcs Compare RCS files with files in another directory.
- #
- # Synopsis:
- # Comprcs [-d <dir>] [-<opts>] [<file>...]
- #
- # Description:
- # Performs an rcsdiff on all files in the local RCS directory with
- # files in the directory specified. If no directory specified, it
- # will check if an environment variable COMPRDIR exists and use the
- # directory there. If neither exists, assumes the local directory.
- #
- # If a file is provided, checks only this file.
- #
- # Revision History:
- # $Log: Comprcs,v $
- # Revision 1.3 91/07/27 19:57:33 chris
- # Fixed problem with recognizing options.
- # Fixed problem with no COMPRDIR environment variable defined.
- #
- # Revision 1.2 91/07/27 19:51:52 chris
- # Modified to allow no directory specification. Will assume current
- # directory.
- # Added -f flag to /bin/csh.
- # Added RCS tags.
- #
- #---------------------------------------------------------------------------
-
- set afile = ""
- set dir = ""
- set opts = ""
-
- while ( "$1" != "" )
- if ( "$1" == "-d" ) then
- set dir = $2
- shift; shift
- else
- set x = `echo "$1" | grep "^-.*"`
- if ( "$x" != "" ) then
- set opts = ($opts $1)
- shift
- else
- set afile = ($afile $1)
- shift
- endif
- endif
- end
-
- if ( "$dir" == "" ) then
- if ( $?COMPRDIR ) then
- set dir = $COMPRDIR
- endif
- endif
-
- if ( "$dir" == "" ) set dir = .
-
- if ( "$afile" == "" ) then
- foreach rcs_file ( RCS/* )
- set base = `basename $rcs_file ,v`
- echo "***--- rcsdiff $dir/$base"
- rcsdiff $opts $dir/$base
- end
- else
- foreach file ( $afile )
- echo "***--- rcsdiff $dir/$file"
- rcsdiff $opts $dir/$file
- end
- endif
-
- ### Local Variables:
- ### auto-fill-hook: nil
- ### End:
-